import json
import os
import ast

file_list = os.listdir("E://user//user3")
ll = []
for i in range(len(file_list)):
    path = "E://user//user3//{}".format(file_list[i])
    f1 = open(path)
    lst = ast.literal_eval(f1.read());
    for i in range(len(lst)):
        if len(lst[i]) == 2:
            ll.append({"name":lst[i][0], "sfzh":lst[i][1]})
    f1.close()

print(len(ll))
f2 = open("user3.json", 'w+')
f2.write(json.dumps(ll))
f2.close()





